package com.mervin.annotation;

import com.mervin.constant.Constants;
import com.mervin.enums.LineParseTypeEnum;

import java.lang.annotation.*;

/***************************************
 * @author: mervin
 * @Date: 2020-05-04 11:03
 * @Description: Bean class parse annotation
 ***************************************/
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface LineParseAnnotation {

    /**
     * line Parse type.
     *
     * @return
     */
    LineParseTypeEnum parseType() default LineParseTypeEnum.SEPARATE;

    /**
     * Line length
     * If it is a fixed-length type, fill in the length of the entire line;
     * If it is a separation type, fill in the length of the separated array.
     * @return
     */
    int length();

    /**
     * If it is a separation type, fill this value.
     * Support regular expression
     */
    String splitChar() default Constants.SPLIT_CHAR_LINE;
}
